package com.woniuxy.orderfeign.controller;

import com.woniuxy.commons.Goods;
import com.woniuxy.commons.annotation.RequirePermission;
import com.woniuxy.commons.service.GoodsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: 15489  <br/>
 * Date: 2022/3/28:10:35  <br/>
 * Description:
 */

@RestController
@RequestMapping("/order")
public class orderController {
//    注入
    @Resource
    private GoodsService goodsService;
    @RequirePermission(value = "goods::find")
    @GetMapping("/all")
    public List<Goods> all(){
//        掉对方
        return  goodsService.all();
    }

    @GetMapping("/add")
    public void  add(){
        Goods goods=new Goods(2001,"电脑",111);
        goodsService.add(goods);
    }
    @GetMapping("/get")
    public String port(){
        return goodsService.getPort();
    }


}
